import { Column, Entity } from "typeorm";
import { BaseEntity } from "../../base/entity/base";

export enum FinanceRecordStatus {
    可提现 = 0,
    入账 = 1,
}

@Entity('finance_record', { comment: '财务流水记录' })
export class FinanceRecordEntity extends BaseEntity {

    @Column({ comment: '钱包ID', nullable: false })
    walletId: number;

    @Column({ comment: '金额', type: 'decimal', precision: 10, scale: 2, nullable: false })
    amount: number;

    @Column({ comment: '类型', nullable: false })
    type: 'income' | 'expense';

    @Column({ comment: '备注', nullable: true })
    remark: string;

    @Column({ comment: '关联ID', nullable: true })
    relatedId: string;

    @Column({ comment: '关联类型', nullable: true })
    relatedType: 'order' | 'product' | 'transport' | 'other';

}